package responses

import (
	"github.com/liyaozong/mengo/contracts/dtos/common"
	"github.com/liyaozong/mengo/contracts/models"
)

// DeviceResponse defines the Response Content for GET Device DTOs.
type DeviceResponse struct {
	common.BaseResponse `json:",inline"`
	Device              models.Device `json:"device"`
}

func NewDeviceResponse(requestId string, message string, statusCode int, device models.Device) DeviceResponse {
	return DeviceResponse{
		BaseResponse: common.NewBaseResponse(requestId, message, statusCode),
		Device:       device,
	}
}

// MultiDevicesResponse defines the Response Content for GET multiple Device DTOs.
type MultiDevicesResponse struct {
	common.BaseWithTotalCountResponse `json:",inline"`
	Devices                           []models.Device `json:"devices"`
}

func NewMultiDevicesResponse(requestId string, message string, statusCode int, totalCount uint32, devices []models.Device) MultiDevicesResponse {
	return MultiDevicesResponse{
		BaseWithTotalCountResponse: common.NewBaseWithTotalCountResponse(requestId, message, statusCode, totalCount),
		Devices:                    devices,
	}
}
